<% @page_title = "SSH Public Keys" %>

<%== part(
  "components/page_header",
  title: "SSH Public Keys",
  back: @project.path,
  right_items: [part("components/button", text: "Register SSH Public Key", link: "#{@project.path}/ssh-public-key/register", extra_class: "mr-2")],
  breadcrumbs: [
    %w[Projects /project],
    [@project.name, @project.path],
    ["SSH Public Keys", "#{@project.path}/ssh-public-key"]
  ]
) %>

<div class="grid gap-6">
  <%== part(
    "components/table_card",
    headers: ["Name"],
    rows: @project.ssh_public_keys(&:by_name).map do |pubkey|
      [
        [
          [pubkey.name, {link: path(pubkey)}],
        ]
      ]
    end,
    empty_state: {
      icon: "hero-server-stack",
      title: "No SSH Public Keys Registered",
      description: "Use the Register SSH Public Key button to register SSH public keys."
    }
  ) %>
</div>
